#!/usr/bin/python
# -*- coding: UTF-8 -*-
print ("你好")

a=1000
print (a)
b=500
print(b)
print("a+b =",a+b)

if a==b :
    print("a==b")
else :
    print("a!=b")

while(a):
    print(a)
    a =a -1

for i in range(0, 100, 2):
    print (i);

c = "abcdefg"
print (c[0])
print (c[1:-1])
c += "123111"
print (c)
print (c[-1])
print (c[-2])
print (c[-3])
print ("字符c:",c)
#c.append("xyz")
print("c字符串长度:",len(c))
n=c.count("1");
print("1出现",n,"次")
print("3在索引为:", c.index("3"))

n=0
for i in c :
    print("c[", n, "]=", i)
    n = n + 1

c=c.upper()
print(c)


def max(a, b):
    if(a >= b):
        return a
        #print("max(", a, ",",  b,")=", a)
    else:
        #print("max(", a, ",",  b,")=", b)
        return b
print(max(1,3))

'''
fo = open("foo.txt", "w+")
print ("文件名: ", fo.name)
print ("是否已关闭 : ", fo.closed)
print ("访问模式 : ", fo.mode)
print ("encoding : ", fo.encoding)
#print ("末尾是否强制加空格 : ", fo.softspace)

fo.write("abcdefg")
fo.close();
'''

fo = open("foo.txt", "r")
print ("文件名: ", fo.name)
print ("是否已关闭 : ", fo.closed)
print ("访问模式 : ", fo.mode)
print ("encoding : ", fo.encoding)
#print ("末尾是否强制加空格 : ", fo.softspace)

a=fo.read()
fo.close();
print ("是否已关闭 : ", fo.closed)

print(a)

import random
print(random.random())
print(random.randbytes(1))
print(random.randint(0,1000))

import _thread
import time

print(time.time())

# 为线程定义一个函数
def print_time( threadName, delay):
   count = 0
   while count < 5:
      time.sleep(delay)
      count += 1
      print ("%s: %s" % ( threadName, time.ctime(time.time()) ))

# 创建两个线程
try:
   _thread.start_new_thread( print_time, ("Thread-1", 2, ) )
   _thread.start_new_thread( print_time, ("Thread-2", 4, ) )
except:
   print ("Error: 无法启动线程")

'''
while 1:
   time.sleep(2)
   print ("线程...")
   pass
'''

time.sleep(1)

#import subprocess
#subprocess.run(["example.exe"])

import os

command  = "svn log " 
print(command)
rootLogList = os.popen(command)